/**
 * 
 */
package neptune.console.cli.commands;

import java.util.List;

import org.springframework.stereotype.Component;

import neptune.console.CLCommand;
import neptune.console.NeptuneCLI;
import neptune.manager.validator.ValidatorResult;

/**
 * @author Roberto Bifulco [info@robertobifulco.it]
 * 
 */
@Component
public class ValExpTopology implements CLCommand {

	@Override
	public String getCommandHelp() {
		return "Validates the given experiment's topology";
	}

	@Override
	public String getCommandName() {
		return "valExpTopology";
	}

	@Override
	public void processCommand(List<String> args) throws Exception {
		ValidatorResult result = NeptuneCLI.getNeptune()
				.validateExperimentTopology(
						NeptuneCLI.getNeptune().getExperiment(args.remove(0)));

		System.out.println(result.getLog().prettyPrint(0));
		System.out.println("Validation Result: " + result.getStatus());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see neptune.console.CLCommand#getParamsDescription()
	 */
	@Override
	public String getParamsDescription() {
		return "<experiment_name>";
	}
}
